﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Viman.WeiXin.QQ.SDK
{
    public class DatetimeHelp
    {
        public static string GetDatetimeNowString()
        {
           TimeSpan ts = DateTime.Now - DateTime.Parse("1970-01-01");

           return Convert.ToString(((Int64)ts.TotalSeconds));
        }

        public static DateTime GetDatetimeFromString(string datetimeString)
        {
            return DateTime.Parse("1970-01-01").AddSeconds(Convert.ToDouble(datetimeString));

        }

    }
}
